package com.lvmama.rhino.pojo.comment.Enum;

/**
 * @Author:caoyong
 * @Description:
 * @Date：2017/9/22
 */
public enum MonthEnum {
    JAN("01","一月"),
    FEB("02","二月"),
    MAR("03","三月"),
    APR("04","四月"),
    MAY("05","五月"),
    JUN("06","六月"),
    JUL("07","七月"),
    AUG("08","八月"),
    SEP("09","九月"),
    OCT("10","十月"),
    NOV("11","十一月"),
    DEC("12","十二月");

    MonthEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private String code;
    private String name;

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 获取枚举
     * @param code 编码
     * @return 对应枚举
     */
    public static MonthEnum getEnum(String code){
        for (MonthEnum en : MonthEnum.values()){
            if(en.getCode().equals(code)){
                return en;
            }
        }
        return null;
    }
}
